<?php
require_once dirname(__FILE__) . '/../includes/common.inc.php';
require_once dirname(__FILE__) . '/../includes/pdoorm.inc.php';

header('Content-Type: text/plain');

$sql="
    insert into ns_v1user SELECT
    a.*, b.pEnabled,
    b.vEnabled,
    b.mEnabled,
    b.pWedding,
    b.pPrewedding,
    b.pPortrait,
    b.pEngagement,
    b.vWedding,
    b.vPrewedding,
    b.vPortrait,
    b.vEngagement,
    b.mStudio,
    b.mHouse,
    b.mFullDay,
    b.lEnabled,
    b.lightingRate,
    b.employmentType,
    b.yearlyRate,
    b.hourlyRate,
    b.commissionRate
FROM
    ns_user a,
    (
        SELECT
            bb.oid_a AS us_eoid,
            aa.*
        FROM
            ns_userskill AS aa
        LEFT JOIN ns__ez_relation_user_userskill AS bb ON aa.e_oid = bb.oid_b
    )b
WHERE
    a.e_oid = b.us_eoid
";

sql_execute($sql);
